set (trt_engine_headers
    ${CMAKE_CURRENT_SOURCE_DIR}/trt_tensor.h
    ${CMAKE_CURRENT_SOURCE_DIR}/trt_engine.h
    ${CMAKE_CURRENT_SOURCE_DIR}/monopoly_allocator.h
    ${CMAKE_CURRENT_SOURCE_DIR}/infer_controller.h
    ${CMAKE_CURRENT_SOURCE_DIR}/preprocess_kernel.cuh
)

set (trt_engine_cuda
    ${CMAKE_CURRENT_SOURCE_DIR}/preprocess_kernel.cu
    # ${CMAKE_CURRENT_SOURCE_DIR}/preprocess_kernel.cuh
)

set (trt_engine_sources
    ${CMAKE_CURRENT_SOURCE_DIR}/trt_tensor.cpp
    ${CMAKE_CURRENT_SOURCE_DIR}/trt_engine.cpp
    ${CMAKE_CURRENT_SOURCE_DIR}/preprocess_kernel.cu
)

# cuda_add_library(trt_engine_cuda SHARED  ${trt_engine_cuda})
# target_include_directories(trt_engine_cuda PRIVATE ${src_dir})
# target_link_libraries(trt_engine_cuda  
#     trt_utils
#     ${OpenCV_LIBS}
# )
# target_link_libraries(trt_engine_cuda PRIVATE )
# target_link_libraries(trt_engine_cuda PRIVATE trt_utils)


cuda_add_library(trt_engine STATIC ${trt_engine_headers} ${trt_engine_sources})
set_target_properties( trt_engine PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
target_include_directories(trt_engine PRIVATE ${src_dir})
target_link_libraries(trt_engine
    ${OpenCV_LIBS}
    trt_utils
)